﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ZLDC.Common.Estate;
using System.Configuration;


namespace ZLDC.Estate.UM
{
    public partial class Tranestate : _PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) 
            {
                
                ZLDC.Topo.BLL.Estate.SystemParamBLL.LoadMarkParamType(slstatus, false, "状态");
                slstatus.Items.Insert(0, "全部");
                string deptid = _Utility.GetInfoBySession().m_sDeptID;

                ddlDept_from.DataSource= ZLDC.DAL.Estate.DeptDAL.getGetAllChildrenDept(deptid,"");
                ddlDept_from.DataTextField = "deptname";
                ddlDept_from.DataValueField = "id";
                ddlDept_from.DataBind();
                ddlDept_from.Items.Insert(0, new ListItem("请选择", ""));
                slusername_from.Items.Insert(0, new ListItem("请选择", ""));

               ddlDept_to.DataSource = ZLDC.DAL.Estate.DeptDAL.getGetAllChildrenDept(deptid, "");
               ddlDept_to.DataTextField = "deptname";
               ddlDept_to.DataValueField = "id";
               ddlDept_to.DataBind();
               ddlDept_to.Items.Insert(0, new ListItem("请选择", ""));
               slusername_to.Items.Insert(0, new ListItem("请选择", ""));

            }
        }

        protected void ddlDept_from_SelectedIndexChanged(object sender, EventArgs e)
        {
            slusername_from.Items.Clear();
           // ZLDC.DAL.Estate.DeptDAL.GetUserListForTran(ddlusername, this.ddlDept1.SelectedValue.ToString().Trim(), 0);
            ZLDC.DAL.Estate.DeptDAL.GetUserListForTran(slusername_from, ddlDept_from.SelectedValue.ToString(), 0);
            slusername_from.Items.Insert(0, new ListItem("请选择", ""));
           

        }

        protected void ddlDept_to_SelectedIndexChanged(object sender, EventArgs e)
        {
            slusername_to.Items.Clear();
            ZLDC.DAL.Estate.DeptDAL.GetUserList(slusername_to, ddlDept_to.SelectedValue.ToString());
            slusername_to.Items.Insert(0, new ListItem("请选择", ""));

        }
    }
}
